package day10_io_code.com.itheima.d2_buffer_stream;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.Reader;

public class BufferedReaderDemo2 {
    public static void main(String[] args) {
        try (
                Reader fr = new FileReader("d:\\demo\\a.txt");
                BufferedReader br = new BufferedReader(fr);
        ){
//            char[] buffer = new char[1024];
//            int len;
//            while ((len = br.read(buffer)) != null){
//                String rs = new String(buffer, 0, len);
//                System.out.print(rs);
//            }

            String line;
            while ((line = br.readLine()) != null){
                System.out.println(line);
            }

        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
